Skip to main content

监控传统服务器和应用_使用OneAgent默认OTEL探针版本

Last updated on

APO 分为两部分:

  • APO-server: APO 服务侧组件
  • APO-one-agent: APO 用户侧组件,用于采集Kubernetes集群或者虚机环境下被监控业务以及集群、主机信息。

本文档包含在 传统服务器(非Kubernetes)上安装和运行 APO-one-agent 的说明。请确保在安装 APO-one-agent 之前,您已经安装 APO-server

APO-one-agent 内置各个编程语言的默认采集探针版本:

  1. Java agent: opentelemetry-java-instrumentation v2.8.0
  2. Python agent: opentelemetry-python 1.23.0/0.44b0
  3. NodeJs agent: opentelemetry-js v1.24.1/0.51.1
  4. Go agent: Grafana Beyla v1.8.4

注意:对于 Java 应用,APO 默认采用 Opentelemetry v2.8.0 采集链路追踪数据,如果您想兼容使用已有的 Java 探针(例如 Skywalking 或 Opentelemetry 其他版本等,请参考 监控传统服务器和应用_使用OneAgent定制探针版本 构建自定义探针镜像并配置。

下载安装包

这里默认下载 latest 版本,本文档接下来以 latest 版本为例

export APO_VERSION=latest
# export APO_VERSION=v0.0.000 # 可以指定您的版本

wget https://apo-ce.oss-cn-hangzhou.aliyuncs.com/apo-one-agent-compose-${APO_VERSION}.tgz

部署 APO-one-agent

运行以下命令,部署 APO-one-agent 传统服务器版本

export APO_VERSION=latest
export APO_PROXY_IP=<YOUR APO-server NodeIP> # FIXME

tar -zxvf apo-one-agent-compose-$APO_VERSION.tgz
cd apo-one-agent-compose/
bash deploy.sh init $APO_SERVER_IP

验证

见到类似输出即代表安装成功

==================================================
___ ___ ___
/\ \ /\ \ /\ \
/::\ \ /::\ \ /::\ \
/:/\:\ \ /:/\:\ \ /:/\:\ \
/::\~\:\ \ /::\~\:\ \ /:/ \:\ \
/:/\:\ \:\__\ /:/\:\ \:\__\ /:/__/ \:\__\
\/__\:\/:/ / \/__\:\/:/ / \:\ \ /:/ /
\::/ / \::/ / \:\ /:/ /
/:/ / \/__/ \:\/:/ /
/:/ / \::/ /
\/__/ \/__/
Official Website: https://apo.kindlingx.com/
DEPLOY_VERSION: <version>
APO_ONE_AGENT_VERSION:
==================================================
INFO: APO-server-ip = <YOUR APO-server NodeIP>
Container apo-otel-collector-agent Started
Container apo-grafana-alloy Started
Container apo-node-agent Started
Container apo-preload-agent Started
Container apo-go-sdk-auto Started
Container apo-ilogtail Started
Container apo-ebpf-agent Started

输入下方命令检查容器是否启动成功

bash deploy.sh list

# 您应该看到类似于以下内容输出
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
apo-ebpf-agent registry.cn-hangzhou.aliyuncs.com/originx/ebpf-agent:v1.5.0 "sh start.sh" apo-ebpf-agent 5 minutes ago Up 5 minutes
apo-go-sdk-auto registry.cn-hangzhou.aliyuncs.com/originx/sdk-auto:v1.0.0 "/app/originx-sdk-au…" apo-go-sdk-auto 5 minutes ago Up 5 minutes
apo-grafana-alloy registry.cn-hangzhou.aliyuncs.com/originx/grafana-alloy:v1.2.1 "/bin/alloy run --st…" apo-grafana-alloy 5 minutes ago Up 5 minutes
apo-ilogtail registry.cn-hangzhou.aliyuncs.com/originx/ilogtail:v1.5.0 "/usr/local/ilogtail…" apo-ilogtail 5 minutes ago Up 5 minutes
apo-node-agent registry.cn-hangzhou.aliyuncs.com/originx/node-agent:v1.5.0 "/app/pinger" apo-node-agent 5 minutes ago Up 5 minutes
apo-otel-collector registry.cn-hangzhou.aliyuncs.com/originx/apo-otel-collector:v0.1.0 "./otelcol --config …" apo-otel-collector-agent 5 minutes ago Up 5 minutes

重启被监控应用

非容器应用

重启应用即可自动监控应用。

Docker 容器应用

APO-one-agent 确认启动完成后,需要根据《在Docker容器内使用one-agent》配置并重启 Docker 应用。

卸载 APO-one-agent

bash deploy.sh stop